import NavLink from 'umi/navlink';
import React from 'react';
import { routes } from '../pages/.umi/router'

import withBreadcrumbs from 'react-router-breadcrumbs-hoc';

class bd extends React.Component {
    render() {
        const Item: any = withBreadcrumbs(routes)(({ breadcrumbs }) => {
            const item: React.ReactNode[] = breadcrumbs;
            return item.map((val: React.ReactNode, index) => (

                < span key={val && val.key} >
                    <NavLink to={val && val.match.url}>
                        {routes[1]._title}
                    </NavLink>
                    {(index < breadcrumbs.length - 1) && <i> / </i>}
                </span >)

            )
        })

        return <Item />;
    }
}

export default bd;
